<?php
    
class ControladorImovel{

    public function cadastrar(Imovel $imovel) {

			include_once("../conexao/config.php");
			$conexao = new Config();

			$query = "insert into imovel values(NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), NOW(), ?)";
			$stmt = $conexao->conectar()->prepare($query);

			$stmt->bindValue(1, $imovel->getCodigo());
			$stmt->bindValue(2, $imovel->getTitulo());
			$stmt->bindValue(3, $imovel->getIdTipo());
			$stmt->bindValue(4, $imovel->getTipoNegocio());
			$stmt->bindValue(5, $imovel->getValor());
			$stmt->bindValue(6, $imovel->getDormitorios());
			$stmt->bindValue(7, $imovel->getSuites());
			$stmt->bindValue(8, $imovel->getGaragem());
			$stmt->bindValue(9, $imovel->getAreaLazer());
			$stmt->bindValue(10, $imovel->getPiscina());
			$stmt->bindValue(11, $imovel->getCaracteristicas());
			$stmt->bindValue(12, $imovel->getIdEndereco());
			$stmt->bindValue(13, $imovel->getFoto());
			$stmt->bindValue(14, $imovel->getAtivado());

			$stmt->execute();               
		}
}
?>